<template>
  <yk-space size="m" class="reply">
    <yk-avatar
      img-url="https://www.huohuo90.com:3003/user/6353b034dd4b583975e77fbe.png"
    >
    </yk-avatar>
    <yk-space dir="vertical" size="s" class="reply_main">
      <div class="reply_name">
        <yk-text strong>{{ content?.user.name }}</yk-text>
        <yk-text type="third" style="font-size: 12px">{{
          content?.moment
        }}</yk-text>
      </div>
      <yk-text type="secondary">{{ content?.comment }}</yk-text>
      <yk-space size="s" align="center">
        <yk-tag type="primary"> {{ content?.article?.title }} </yk-tag>
        <yk-text type="danger" v-show="content?.complaint! > 0"
          >举报 {{ content?.complaint }}</yk-text
        >
      </yk-space>
        <IconDeleteOutline class="reply_main-delete" @click="deleteReply(props.content!.id)"/>
    </yk-space>
  </yk-space>
</template>

<script setup lang="ts">
import type { ReplyProps } from "./reply";

const props = withDefaults(defineProps<ReplyProps>(), {
  isComment: true,
});

const emits = defineEmits(["delete"])

// 删除
const deleteReply =(e:number)=>{
  emits("delete",e)
}
</script>

<style scoped lang="less">
.reply {
  width: 100%;
  &_main {
    border-bottom: 1px solid @line-color-s;
    width: 100%;
    padding-bottom: @space-l;
    flex:1;
    position: relative;
    &-delete{
      position: absolute;
      right: 0;
      top: 0;
      width: 16px;
      height: 16px;
      cursor: pointer;
      color: @font-color-s;
      display: none;
    }
  }
  &_name {
    display: flex;
    flex-direction: column;
  }
  &:hover{
    .reply_main-delete{
      display: block;
    }
  }
}
</style>
